<?PHP

		$deleted=FALSE;
		$post=$_POST;
		include 'm/media/p_media_content.php';
		
if($_POST['delete']=='delete')
{
		mp('delete');
		rp($_GET['id']);
		
		delete_sql($table,$id,$_GET['id'],FALSE);
	
		printmessage('Successfully Deleted');
		$deleted=TRUE;
}
else if($_POST['cmd']=='add' && !empty($_POST[$catch]))
{
	if(!empty($image_data))
	{
	
		$post['image']=$image_data['image'];
		$post['thumb']=	$image_data['thumb'];
	}
		$post=process_default_serialized_values($post);
		process_sql_post($post,$table,'add',NULL,NULL);
		printmessage('Successfully Added');
}
else if($_POST['cmd']=='edit')
{
	if(!empty($image_data))
	{
	
		$post['image']=$image_data['image'];
		$post['thumb']=	$image_data['thumb'];
	}
		$post=process_default_serialized_values($post);
		process_sql_post($post,$table,'update',$id,$_GET[$id]);
		printmessage('Successfully Modified');
}

if($_GET['cmd']=='edit' && isset($_GET[$id]) && !$deleted)
{
		$e=get_data_form($table,$id);

	if($e['serial'] == 'N;' || empty($e['serial']) )
	{
	
			
	}
	else
	{
			$serial=unserialize($e['serial']);
			$e=array_merge($e,$serial);	
	}
	
	
}
else
{
		$_GET['cmd']='add';
}

?>